// See https://sequelize.org/master/manual/model-basics.html
// for more of what you can do here.
const Sequelize = require('sequelize');
const DataTypes = Sequelize.DataTypes;

module.exports = function (app) {
  const sequelizeClient = app.get('sequelizeClient');
  const cusmanage = sequelizeClient.define('cusmanage', {
    //类型 
    type: {
      type: DataTypes.STRING,
    },
    //客服编号
    serviceid: {
      type: DataTypes.STRING,
    },
    //标题
    title: {
      type: DataTypes.STRING,
    },
    //客户名称
    cusname: {
      type: DataTypes.STRING,
    },
    //服务方式
    serstyle: {
      type: DataTypes.STRING,
    },
    //来源
    resource: {
      type: DataTypes.STRING,
    },
    //服务日期
    serdata: {
      type: DataTypes.DATE,
    },
    //创建人
    director: {
      type: DataTypes.STRING,
    },
    // 状态
    status: {
      type: DataTypes.STRING,
    },
    // 附件
    appadd: {
      type: DataTypes.STRING,
    },
    // 客户反馈
    cusfeedback:{
      type:DataTypes.TEXT,
    },
    // 服务内容
    sercontent:{
      type:DataTypes.TEXT
    },
    // 备注
    describe:{
      type:DataTypes.TEXT
    }
  }, {
    hooks: {
      beforeCount(options) {
        options.raw = true;
      }
    }
  });

  // eslint-disable-next-line no-unused-vars
  cusmanage.associate = function (models) {
    // Define associations here
    // See https://sequelize.org/master/manual/assocs.html
  };

  return cusmanage;
};
